home *** CD-ROM | disk | FTP | other *** search
- //---------------------------------------------------------------------------
- #include <vcl\vcl.h>
- #pragma hdrstop
-
- #include "Rechen2.h"
- //---------------------------------------------------------------------------
- #pragma resource "*.dfm"
-
- TForm1 *Form1;
- double Zahl1, Zahl2, Ergebnis;
-
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Label3Click(TObject *Sender)
- {
- randomize ();
- Zahl1 = double (random (1000)) /10;
- Zahl2 = double (random (1000)) /10;
- Label1->Caption = String (Zahl1);
- Label2->Caption = String (Zahl2);
- Label3->Caption = "WΣhle die Rechenart!";
- }
- //---------------------------------------------------------------------------
-
- void __fastcall TForm1::Button1Click(TObject *Sender)
- {
- Ergebnis = Zahl1 + Zahl2;
- Label3->Caption = "Ergebnis der Addition: " + String(Ergebnis);
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Button2Click(TObject *Sender)
- {
- Ergebnis = Zahl1 - Zahl2;
- Label3->Caption = "Ergebnis der Subtraktion: " + String(Ergebnis);
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Button3Click(TObject *Sender)
- {
- Ergebnis = Zahl1 * Zahl2;
- Label3->Caption = "Ergebnis der Multiplikation: " + String(Ergebnis);
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Button4Click(TObject *Sender)
- {
- Ergebnis = Zahl1 / Zahl2;
- Label3->Caption = "Ergebnis der Division: " + String(Ergebnis);
- }
- //---------------------------------------------------------------------------
-